"""
tcp 客户端流程
"""
from socket import *

# 服务器地址
ADDR = ("127.0.0.1",8880)

# tcp套接字
sock = socket()

# 连接服务端
sock.connect(ADDR)

# 循环发送接收数据
while True:
    msg = input(">>")
    sock.send(msg.encode())
    if msg == "##":
        break
    data = sock.recv(1024)
    print("From server:",data.decode())

sock.close()

